Skip to content

Rename AvailableEntityTypes to EmbeddedEntityTypes - #38565

Merged
pmbrull merged 5 commits into
mainfrom
refactor/embedded-entity-types
Nov 26, 2026
Merged

pmbrull merged 5 commits into
mainfrom
refactor/embedded-entity-types

Conversation

@manerow

@manerow manerow commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

No issue: a rename, plus the removal of code nothing calls any more.

I renamed AvailableEntityTypes to EmbeddedEntityTypes and gave its members names that say what they are, because the old names hid three things:

  • LIST really means "entity types that get vector embeddings". Nothing in the name says so.
  • LIST and SET hold the same types and differ only in casing (SET is lowercased), which the names do not show.
  • Since Ontology concepts and properties get their own search index with embeddings #38465 the list mixes data-asset types and ontology types, and those live under different aliases (dataAssetEmbeddings and ontologyTerms). A caller that wanted "what chat search can reach" took the whole list and got the ontology types too. That is how Collate's chat search ended up offering ontology types as filters.

The new class, in the same package:

Old New What it is
LIST ALL Every embedded type, original casing
DATA_ASSET_CHUNK_TYPES (lowercased set) DATA_ASSETS (list, original casing) ALL minus ontology terms: exactly the dataAssetEmbeddings members
SET, isVectorIndexable(type) isEmbedded(type) Case-insensitive lookup in ALL
DATA_ASSET_CHUNK_TYPES.contains(...) isDataAsset(type) Case-insensitive lookup in DATA_ASSETS

AvailableEntityTypes is deleted, with no deprecated wrapper. The lowercase sets are now private to the class.

This PR also removes the hybrid RRF search pipeline code. OpenMetadata created, refreshed and checked an OpenSearch search pipeline, hybrid-rrf, that nothing in OpenMetadata ran. Its only caller, Collate's hybrid search, now fuses its keyword and semantic results itself (Collate PR #8899). #38517 reverted this deletion to keep Collate compiling; it comes back here unchanged. Gone: HYBRID_PIPELINE_NAME, buildHybridRrfPipelineDefinition, getHybridRrfPipelineDefinition and the ensure, update, check and uses HybridSearchPipeline methods of OpenSearchVectorService and SearchRepository, with their calls on vector service start, in the Search Indexing preflight, on search settings save and in the deployment status. Its embeddings step now just says "Embeddings are working correctly." on both engines. getHybridWeights() stays, and so does the searchPipeline configuration key (now described as ignored), so existing configuration files still load.

Type of change:

  • Improvement

High-level design:

Every use moved, in main and test code. Two callers needed more than a rename:

  • RecreateWithEmbeddings counted how many data-asset types a reindex run covers by lowercasing the run's types and looking them up in the lowercased set. It now asks isDataAsset for each type the run names and counts distinct lowercased names. The result is the same, and a new test checks that one type named in two casings does not stand in for a missing type.
  • The staged chunk recreate in AbstractVectorIndexService keeps a per-run checklist (stagedExpectedTypes) and ticks off types as they finish, keyed by the lowercased name. A case-insensitive lookup can say whether one type is on the checklist, but not whether every type has finished, which needs the whole set of keys. So it keeps a lowercased copy of DATA_ASSETS as a constant, at the one place that needs it.

VectorEmbeddingHandler's lifecycle types become Set.copyOf(DATA_ASSETS), which is the same set it built by hand before.

Merge order. Everything this PR waited for has merged: Collate PR #8922, #38415, #38517 and Collate PR #8899. It is the last PR of the hybrid search chain.

Uses that #38415 and #38517 added are switched too, in the merge of main: EmbeddingEnricher, PartitionWorker, AbstractVectorIndexService, RecreateWithEmbeddings, OpenMetadataOperations, and the tests RecreateWithEmbeddingsTest, ElasticSearchVectorServiceTest and VectorChunkIndexIT (SET.forEach becomes ALL.forEach, the same types).

Decision record. No new record. The rename's rule is in the class Javadoc and enforced by EmbeddedEntityTypesConsistencyTest. Amended: ADR:2026-11-23-the-hybrid-rrf-pipeline-leaves-openmetadata (v2: the deletion landed) and ADR:2026-11-20-elasticsearch-and-opensearch-share-one-vector-index-service (v5: hybrid search is no longer OpenSearch-only; it names EmbeddedEntityTypes.DATA_ASSETS). The Guard line of ADR:2026-11-23-ontology-terms-have-dedicated-search-indexes names the renamed test.

Tests:

Use cases covered

  • Every type that was embedded is still embedded, and the same types are searched through dataAssetEmbeddings.
  • A full reindex still stages the chunk recreate whatever the casing of the types in the job.
  • Search Indexing, search settings saves and the deployment status no longer touch a search pipeline.

Unit tests

  • I added unit tests for the new/changed logic.
  • EmbeddedEntityTypesTest (new): DATA_ASSETS is ALL without the two ontology types; the lookups ignore case and reject null and non-embedded types.
  • EmbeddedEntityTypesConsistencyTest (renamed from AvailableEntityTypesConsistencyTest): now compares DATA_ASSETS with the alias members in their original casing, which is stricter than the old lowercased comparison, and checks that ontology types are embedded but are not data assets.
  • RecreateWithEmbeddingsTest: moved to ALL, plus the two-casings case above.
  • Pipeline tests removed with the code: the pipeline cases of OpenSearchVectorServiceTest, SearchRepositoryBehaviorTest, ReindexingOrchestratorTest and SystemRepositoryEmbeddingsValidationTest, and the pipeline scenario of VectorEmbeddingIntegrationIT.

Backend integration tests

  • Not applicable (no backend API changes).

Local Java test run: PASSED

  • Commit: b24edf9fefd1 (base origin/main)
  • Finished: 2026-11-24 08:45 UTC · 1.1 min
  • Scope: focused; merge readiness is not established. Broader steps deferred: 10 (run --scope full).
Step Scope Classes Tests Failed Skipped Min Result
unit openmetadata-service (5 classes) 5 63 0 0 1.1 passed
  • Impacted, not run locally: 15 classes (listed in the details)

The block above is from the previous head. On the current head (main merged in at c6f53f84304), run locally:

  • mvn install -DskipTests -pl openmetadata-service -am: passed.
  • Unit tests: every class in org.openmetadata.service.search and its subpackages, plus SearchRepository*, SystemRepository*, SystemResource*, RecreateWithEmbeddingsTest, OpenMetadataOperations*, EmbeddedEntityTypes*, the bulk sink tests and ReindexingOrchestratorTest: 227 classes, 3472 tests, 0 failed, 0 skipped.
  • test-compile of openmetadata-integration-tests: passed. The ITs themselves were not run locally.
  • Collate main built against this branch (mvn install -DskipTests, without the UI and dist modules) and its integration tests compiled: passed. That build used ai-platform main, as Collate CI does.

Ingestion integration tests

  • Not applicable (no ingestion changes).

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

None: no behaviour change; the unit tests above cover each moved caller.

UI screen recording:

Not applicable: backend refactor with no UI change.

Checklist:

  • I have read the CONTRIBUTING document.

  • My PR title is Fixes <issue-number>: <short explanation>

  • My PR is linked to a GitHub issue via Fixes #<issue-number> above.

  • I have commented on my code, particularly in hard-to-understand areas.

  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

  • For a UI feature or feature task: as part of PR creation, I ran the PR build in Docker with sample data and embedded a verified GitHub-hosted recording plus build/health evidence above (or explained why this requirement is not applicable).

  • I have added tests (unit / integration / Playwright as applicable) and listed them above.

  • Self-review: I reviewed the final diff against REVIEW.md (the pr-checklist skill runs it) and fixed every 🔴 finding, or answered it on the line below.

  • Decision check: if this PR decides something the next contributor could undo — a schema field, REST path or format another component or repo must agree with, a new default or limit, an ordering that must hold, or a rule stated only in this description — it adds a record under docs/decisions/ (see its README.md). This description is gone from git log after the squash-merge.

  • I have added tests around the new logic.

@manerow
manerow requested a review from a team as a code owner November 24, 2026 09:01
@manerow
manerow requested a review from IceS2 November 24, 2026 09:01
@manerow manerow added the skip-pr-checks Bypass PR metadata validation check label Nov 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

@manerow manerow added the safe to test Add this label to run secure Github workflows on PRs label Nov 24, 2026
@gitar-bot

gitar-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 🟡 Medium risk

Removing OpenSearch RRF pipeline management and checks shifts hybrid fusion to callers, so callers still relying on server normalization could rank results differently.

Renames AvailableEntityTypes to EmbeddedEntityTypes with clearer member names (ALL, DATA_ASSETS, isEmbedded, isDataAsset) and removes the unused hybrid RRF search pipeline code. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@pmbrull
pmbrull merged commit 62ffc33 into main Nov 26, 2026
53 checks passed
@pmbrull
pmbrull deleted the refactor/embedded-entity-types branch November 26, 2026 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants